package com.logica.hackthon;

import com.flca.IFlcaStartup;
import com.flca.frw.dao.ConnectionPoolMgr;
import com.flca.frw.dao.IConnectionPoolMgr;
import com.flca.frw.util.IConfigurationHelper;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.name.Names;
import com.logica.hackthon.dao.impl.PlayerDaoImplJpa;
import com.logica.hackthon.dao.intf.PlayerDaoIntf;
import com.logica.hackthon.service.HackThonService;
import com.logica.hackthon.service.IHackThonService;
import com.logica.hackthon.service.impl.HackThonServiceImpl;
import com.logica.hackthon.service.intf.HackThonServiceIntf;

public class HackThonModule extends AbstractModule implements HackThonConstants
{
	@Override
	protected void configure()
	{
		//-- startup engine
		bind(IFlcaStartup.class).to(HackThonFlcaStartup.class).in(Scopes.SINGLETON);
		
		//-- ConfigurationHelper
		bind(IConfigurationHelper.class).to(HackThonConfighelper.class).in(Scopes.SINGLETON);
		
		bind(IConnectionPoolMgr.class).to(ConnectionPoolMgr.class).in(Scopes.SINGLETON);

		bindConstant().annotatedWith(Names.named("CONFIG_DIRS")).to(CONFIG_DIRS);
		bindConstant().annotatedWith(Names.named( "MAIN_PROPERTIES")).to(MAIN_PROPERTIES);
		
		bind(HackThonServiceIntf.class).to(HackThonServiceImpl.class).in(Scopes.SINGLETON);
		bind(IHackThonService.class).to(HackThonService.class).in(Scopes.SINGLETON);
		
		bind(PlayerDaoIntf.class).to(PlayerDaoImplJpa.class);

	}
	
	

}
